package com.nf.xiaomi.web.controller;

import com.nf.mvc.ViewResult;
import com.nf.mvc.mapping.RequestMapping;
import com.nf.mvc.support.ResponseVO;
import com.nf.xiaomi.entity.EmployeeEntity;
import com.nf.xiaomi.service.EmployeeService;
import com.nf.xiaomi.service.impl.EmployeeServiceImpl;

import java.util.List;

import static com.nf.mvc.handler.HandlerHelper.json;

@RequestMapping("/employee")
public class EmployeeController {
    EmployeeService service = new EmployeeServiceImpl();

    @RequestMapping("/getAllAccount")
    public ViewResult getAll(String empAccount) {
        List<EmployeeEntity> name = service.getAll(empAccount);
        return json(new ResponseVO(200, "ok", name));
    }

    @RequestMapping("/getAll")
    public ViewResult getAll() {
        List<EmployeeEntity> empAll = service.getAll();
        return json(new ResponseVO(200, "ok", empAll));
    }
}
